#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll N=100086;
ll n,ans,p;
int a[N];//value
bool b[N];//if it have strike
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    //scanf("%lld",&n);
    cin>>n;ans=n;
    for(int i=1;i<=n;i++)// input the value
    {
        //scanf("%d",a[i]);
        cin>>a[i];
        if(a[i]<=2)
            p++;
    }
    sort(a+1,a+n+1);//sort them from small to big

    //for(int i=1;i<=n;i++)
        //cout<<a[i];
    if(p>150)
    {
        for(int i=n;i>=1;i--)
        {
            if(a[i]==1)
            {
                //printf("%lld",(n-i)+abs((n-i)-i));
                if(i<=n-i)
                    ans=n-i;
                else
                ans=(n-i)+abs(i-(n-i));
                break;
            }


        }
    }
    else
    for(int i=1;i<=n;i++)// cout of time limit
    {
        for(int j=i;j>=1;j--)
        {
            if(a[i]==a[j])
                continue;
            if(a[j]<a[i] && b[i]==0)
            {
                ans--;
                b[i]=1;b[j]=1;
                break;
            }

        }

    }
    cout<<ans;

    return 0;
}
